package obs.converter;

import java.text.ParseException;
import java.text.SimpleDateFormat;

import org.apache.commons.beanutils.Converter;

public class DateConverter implements Converter {

    @SuppressWarnings("unchecked")
    @Override
    public Object convert(Class type, Object value) {

        SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd"); 
        try {
            return format.parse((String) value);
        } catch (ParseException e) {
            e.printStackTrace();
            return null;
        }
    }

}
